<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>添加</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script type="text/javascript" charset="utf-8"
	src="static/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
	src="static/ueditor/ueditor.all.min.js"> </script>

<script type="text/javascript" charset="utf-8"
	src="static/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="static/js/index.js"></script>  
 <style type="text/css">
div {
	width: 100%;
}
</style>
<link href="static/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="static/admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="static/admin/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="static/admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="pd-20">
    <form action="party/save.do" method="post" class="form form-horizontal" id="">
		
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>标题：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="" placeholder="" id="" name="PARTY_TITLE" datatype="*2-16" nullmsg="标题不能为空">
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>来源：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="" placeholder="" id="" name="PARTY_RESOURCE" datatype="*2-16" nullmsg="标题不能为空">
      </div>
      <div class="col-4"> </div>
    </div>
     <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>内容：</label>
      <div class="formControls col-5">
      <!-- 初始化编辑器 -->
        <script id="editor" type="text/plain" style="width:800px;height:300px;" name="PARTY_CONTENT"></script>
      </div>
      <div class="col-4"> </div>
    </div>
		
	<div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>等级：</label>
      <div class="formControls col-5 skin-minimal">
        <div class="radio-box">
          <input type="radio" id="sex-1" value="0" name="PARTY_LEVEL" datatype="*" nullmsg="请设置等级！" >
          <label for="sex-1">普通</label>
        </div>
        <div class="radio-box">
          <input type="radio" id="sex-2" name="PARTY_LEVEL" value="1">
          <label for="sex-2">高级</label>
        </div>
      </div>
      <div class="col-4"> </div>
    </div>
		<div class="row cl">
      <div class="col-9 col-offset-3">
        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
      	 <a class="btn btn-danger" href="party/list.do">取消</a>
      </div>
    </div>
		</form>
		</div>


  <script type="text/javascript" src="static/admin/lib/jquery/1.9.1/jquery.min.js"></script> 
  <script type="text/javascript" src="static/admin/lib/icheck/jquery.icheck.min.js"></script> 
  <script type="text/javascript" src="static/admin/lib/Validform/5.3.2/Validform.min.js"></script>
  <script type="text/javascript" src="static/admin/lib/layer/1.9.3/layer.js"></script>
  <script type="text/javascript" src="static/admin/js/H-ui.js"></script> 
  <script type="text/javascript" src="static/admin/js/H-ui.admin.js"></script>
  <script type="text/javascript">
		
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor');


    function isFocus(e){
        alert(UE.getEditor('editor').isFocus());
        UE.dom.domUtils.preventDefault(e)
    }
    function setblur(e){
        UE.getEditor('editor').blur();
        UE.dom.domUtils.preventDefault(e)
    }
    function insertHtml() {
        var value = prompt('插入html代码', '');
        UE.getEditor('editor').execCommand('insertHtml', value)
    }
    function createEditor() {
        enableBtn();
        UE.getEditor('editor');
    }
    function getAllHtml() {
        alert(UE.getEditor('editor').getAllHtml())
    }
    function getContent() {
        var arr = [];
        arr.push("使用editor.getContent()方法可以获得编辑器的内容");
        arr.push("内容为：");
        arr.push(UE.getEditor('editor').getContent());
        alert(arr.join("\n"));
    }
    function getPlainTxt() {
        var arr = [];
        arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容");
        arr.push("内容为：");
        arr.push(UE.getEditor('editor').getPlainTxt());
        alert(arr.join('\n'))
    }
    function setContent(isAppendTo) {
        var arr = [];
        arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容");
        UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo);
        alert(arr.join("\n"));
    }
    function setDisabled() {
        UE.getEditor('editor').setDisabled('fullscreen');
        disableBtn("enable");
    }

    function setEnabled() {
        UE.getEditor('editor').setEnabled();
        enableBtn();
    }

    function getText() {
        //当你点击按钮时编辑区域已经失去了焦点，如果直接用getText将不会得到内容，所以要在选回来，然后取得内容
        var range = UE.getEditor('editor').selection.getRange();
        range.select();
        var txt = UE.getEditor('editor').selection.getText();
        alert(txt)
    }

    function getContentTxt() {
        var arr = [];
        arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");
        arr.push("编辑器的纯文本内容为：");
        arr.push(UE.getEditor('editor').getContentTxt());
        alert(arr.join("\n"));
    }
    function hasContent() {
        var arr = [];
        arr.push("使用editor.hasContents()方法判断编辑器里是否有内容");
        arr.push("判断结果为：");
        arr.push(UE.getEditor('editor').hasContents());
        alert(arr.join("\n"));
    }
    function setFocus() {
        UE.getEditor('editor').focus();
    }
    function deleteEditor() {
        disableBtn();
        UE.getEditor('editor').destroy();
    }
    function disableBtn(str) {
        var div = document.getElementById('btns');
        var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
        for (var i = 0, btn; btn = btns[i++];) {
            if (btn.id == str) {
                UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
            } else {
                btn.setAttribute("disabled", "true");
            }
        }
    }
    function enableBtn() {
        var div = document.getElementById('btns');
        var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
        for (var i = 0, btn; btn = btns[i++];) {
            UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
        }
    }

    function getLocalData () {
        alert(UE.getEditor('editor').execCommand( "getlocaldata" ));
    }

    function clearLocalData () {
        UE.getEditor('editor').execCommand( "clearlocaldata" );
        alert("已清空草稿箱")
    }
   
    $(function(){
    	$('.skin-minimal input').iCheck({
    		checkboxClass: 'icheckbox-blue',
    		radioClass: 'iradio-blue',
    		increaseArea: '20%'
    	});
    	
    	$("#form-member-add").Validform({
    		tiptype:2,
    		callback:function(form){
    			form[0].submit();
    			var index = parent.layer.getFrameIndex(window.name);
    			parent.$('.btn-refresh').click();
    			parent.layer.close(index);
    		}
    	});
    });
</script>
	
</body>
</html>
